package com.gis.visualization.controller;


import com.gis.visualization.config.result.R;
import com.gis.visualization.entity.FigureType;
import com.gis.visualization.service.FigureTypeService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hqz
 * @since 2021-03-15
 */
@RestController
@RequestMapping("/visualization/figuretype")
public class FigureTypeController {
    @Autowired
    private FigureTypeService typeService;

    @ApiOperation("获取人物的类型")
    @GetMapping("getFigureTypes")
    @Cacheable(value = "types",key = "'figureTypes'")
    public R getEventTypes() {
        List<FigureType> figureTypes = typeService.list(null);
        return R.ok().data("figureTypes",figureTypes);
    }
}

